﻿//时间
$.fn.configTime = function (timeType, setMinMaxT) {

    var currYear = (new Date()).getFullYear();
    var _min = !!setMinMaxT ? setMinMaxT.min ? setMinMaxT.min : (currYear - 100) : (currYear - 100),
        _max = !!setMinMaxT ? setMinMaxT.max ? setMinMaxT.max : (currYear + 100) : (currYear + 100);
    var opt = {};
    opt.date = { preset: 'date' };
    opt.datetime = { preset: 'datetime' };
    opt.time = { preset: 'time' };
    opt.default = {
        theme: 'android-ics light', //皮肤样式
        display: 'modal', //显示方式
        mode: 'scroller', //日期选择模式
        dateFormat: 'yyyy-mm-dd',
        lang: 'zh',
        showNow: true,
        nowText: "今天",
        startYear: _min, //开始年份
        endYear: _max //结束年份
    };
    $(this).on('focus', function () {
        $(this).blur();
    });
    return $(this).mobiscroll($.extend(opt[timeType], opt['default']));

}
